Skip to content

Add chat x402 template#724

Open
285729101 wants to merge 1 commit intoMerit-Systems:masterfrom
285729101:feat/chat-x402-template
Open

Add chat x402 template#724
285729101 wants to merge 1 commit intoMerit-Systems:masterfrom
285729101:feat/chat-x402-template

Conversation

@285729101
Copy link

Closes #610

Adds a new chat-x402 template under /templates. Its basically the next-chat template but with an auth switcher so users can pick between Echo credits or connecting a wallet to pay with USDC via x402.

Reused the chat interface from next-chat and pulled in the wallet connection flow from the sora-template (RainbowKit + wagmi + x402 payment header util). The auth modal gives two options: Echo OAuth or wallet connect. Once either is connected, same chat experience.

New files worth looking at:

  • auth-modal.tsx / connection-selector.tsx / auth-guard.tsx - the auth switcher logic
  • providers.tsx - wraps EchoProvider + WagmiProvider + RainbowKit
  • lib/402/createPaymentHeader.ts - x402 payment header utility
  • lib/wagmi-config.ts - chain config (Base + Mainnet)

@vercel
Copy link
Contributor

vercel bot commented Feb 18, 2026

@285729101 is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

@285729101 285729101 mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat x402 template

1 participant